
 /**
 * @file tkl_poll_manager.h
 * @brief Common process - poll manager
 * @version 1.0.0
 * @date 2021-05-13
 *
 * @copyright Copyright 2021-2022 Tuya Inc. All Rights Reserved.
 *
 */

#ifndef __TKL_POLL_MANAGER_H__
#define __TKL_POLL_MANAGER_H__


#ifdef __cplusplus
    extern "C" {
#endif

#include "tuya_cloud_types.h"


/*
 * zigbee data request result
*/
typedef enum {
    TKL_POLL_IDLE = 0,
    TKL_POLL_SUCESS,        ///< poll succeeded and get remote data
    TKL_POLL_BUSY_FAIL,     ///< poll failed because the data could not be sent out for some reasons(CCA fail or not low buff)
    TKL_POLL_NO_ACK_FAIL,   ///< poll failed because no MAC ack receive
} TKL_POLL_STATUS_E;

/* zigbee poll manager callback */
typedef VOID_T (*TKL_ZG_POLL_MGR_CB)(VOID_T);

/* zigbee poll callback */
typedef VOID_T (*TKL_ZG_POLL_CMP_CB)(TKL_POLL_STATUS_E status);


/*
 * zigbee scan policy structure
*/
typedef struct {
    TKL_ZG_POLL_CMP_CB poll_cmp_cb;
    TKL_ZG_POLL_MGR_CB poll_mgr_cb;
} TKL_POLL_CB_T;


/**
 * @brief send zigbee data request
 *
 * @param[in]   none
 * @return  OPRT_OK: success  Other: fail
 */
OPERATE_RET tkl_zg_poll_data_send(VOID_T);

/**
 * @brief register zigbee poll callback
 *
 * @param[in]   poll_cb: poll callback
 * @return  OPRT_OK: success  Other: fail
 */
OPERATE_RET tkl_zg_poll_cb_register(TKL_POLL_CB_T *poll_cb);




#ifdef __cplusplus
}
#endif

#endif
